<html>
<head><meta charset="utf-8"><title>Borrow checker · new members · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/index.html">new members</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Borrow.20checker.html">Borrow checker</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="230414234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Borrow%20checker/near/230414234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> younes-io <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Borrow.20checker.html#230414234">(Mar 15 2021 at 20:36)</a>:</h4>
<p>Hi everyone,<br>
Is it correct to claim that the Rust borrow checker is exactly enforcing the rules of the Reader-Writer problem ?<br>
Where can I find that in the compiler's docs ?<br>
Thank you,</p>



<a name="230414682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Borrow%20checker/near/230414682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Borrow.20checker.html#230414682">(Mar 15 2021 at 20:39)</a>:</h4>
<p>what is the reader-writer problem?</p>



<a name="230414846"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Borrow%20checker/near/230414846" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> younes-io <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Borrow.20checker.html#230414846">(Mar 15 2021 at 20:40)</a>:</h4>
<p>It is described here :<br>
<a href="https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem">https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem</a></p>



<a name="230414882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Borrow%20checker/near/230414882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Borrow.20checker.html#230414882">(Mar 15 2021 at 20:41)</a>:</h4>
<p>which variant are you interested in?</p>



<a name="230415051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Borrow%20checker/near/230415051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Borrow.20checker.html#230415051">(Mar 15 2021 at 20:42)</a>:</h4>
<p>I think literally this?: <a href="https://doc.rust-lang.org/reference/expressions/await-expr.html">https://doc.rust-lang.org/reference/expressions/await-expr.html</a></p>



<a name="230419933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Borrow%20checker/near/230419933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Borrow.20checker.html#230419933">(Mar 15 2021 at 21:16)</a>:</h4>
<p>you may be interested in <a href="https://manishearth.github.io/blog/2015/05/30/how-rust-achieves-thread-safety/">https://manishearth.github.io/blog/2015/05/30/how-rust-achieves-thread-safety/</a> and <a href="https://manishearth.github.io/blog/2015/05/17/the-problem-with-shared-mutability/">https://manishearth.github.io/blog/2015/05/17/the-problem-with-shared-mutability/</a></p>



<a name="230419967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Borrow%20checker/near/230419967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Borrow.20checker.html#230419967">(Mar 15 2021 at 21:16)</a>:</h4>
<p>tl;dr thread-safety is not just write tears, and shared XOR mutable is useful for things besides threading</p>



<a name="231020405"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122652-new%20members/topic/Borrow%20checker/near/231020405" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Konrad Borowski <a href="https://rust-lang.github.io/zulip_archive/stream/122652-new-members/topic/Borrow.20checker.html#231020405">(Mar 19 2021 at 13:15)</a>:</h4>
<p>Rust provides RwLock (<a href="https://doc.rust-lang.org/std/sync/struct.RwLock.html">https://doc.rust-lang.org/std/sync/struct.RwLock.html</a>) which solves reader-writers problem</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>